package com.xiaomi.util;

import lombok.Data;

import java.io.Serializable;

/**
 * @author： YongZ
 * @date： 2024/5/29
 * @description：
 * @modifiedBy：
 */


@Data
public class JsonResult implements Serializable {

    private String code;
    private String msg;
    private String data;

    public JsonResult(String number, String msg, Object o) {
        this.code = number;
        this.msg = msg;
        this.data = o.toString();
    }


    public static JsonResult fail(String msg) {
        return new JsonResult("201", msg, "null");
    }

    public static JsonResult success(Object o) {
        return new JsonResult("200", "success", o);
    }
}
